package com.prs.crm.dao.sys.impl;

import java.util.List;

import org.hibernate.Criteria;
import org.hibernate.criterion.Restrictions;

import com.prs.crm.dao.impl.BaseDaoImpl;
import com.prs.crm.dao.sys.DefaultDesktopSetDao;
import com.prs.crm.domain.sys.DefaultDesktopSet;

public class DefaultDesktopSetDaoImpl extends BaseDaoImpl<DefaultDesktopSet> implements DefaultDesktopSetDao{

	@SuppressWarnings("unchecked")
	@Override
	public List<DefaultDesktopSet> getAllDefaultDesktopSet() {
		Criteria criteria =this.getSession().createCriteria(DefaultDesktopSet.class);
		return criteria.list();
	}

	@Override
	public DefaultDesktopSet getDefaultDesktopSet(String ids) {
		Criteria criteria =this.getSession().createCriteria(DefaultDesktopSet.class);	
		criteria.add(Restrictions.eq("inserCode", ids));
		List result=criteria.list();
		if (result==null ||result.size()==0) {
			return null;
		}
		return (DefaultDesktopSet) criteria.list().get(0);
	}

}
